<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\helpers\ArrayHelper;
use common\components\CategoryHelper;

/* @var $this yii\web\View */
/* @var $model common\models\Page */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="page-form">

    <?php $form = ActiveForm::begin(); ?>
    <div class="row">
        <div class="col-md-3">
            <?php
            echo $form->field($model, 'cid')->label(YII::t('common', 'Caeeer ID'))
                    ->dropDownList(ArrayHelper::map(CategoryHelper::CareerSelect(), 'cid', 'title'), ['prompt' => 'Select Category'], array('disabled' => !$model->isNewRecord));
            ?>
        </div>
    </div>
    <?= $form->field($model, 'title')->textInput(['maxlength' => true]) ?>
    <?= $form->field($model, 'author')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'description')->textarea(array('rows'=>2))->label(Yii::t('common', 'description')) ?>

    <?php
    echo $form->field($model, 'content')->widget('common\widgets\ueditor\Ueditor', [
        'options' => ['initialFrameWidth' => "100%",]
    ])->label(Yii::t('common', 'content'));
    ?>

    <?= $form->field($model, 'slug')->textInput() ?>

    <!--<?//= $form->field($model, 'updated_at')->textInput() ?>-->

    <!--<?//= $form->field($model, 'enabled')->textInput() ?>-->

    <div class="form-group">
        <?= Html::submitButton($model->isNewRecord ? Yii::t('common', 'Create') : Yii::t('common', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
    </div>

    <?php ActiveForm::end(); ?>

</div>
